<template>
	<view class="page-login" :style="{backgroundImage: 'url('+info.picUrl+')'}">
		<u-navbar back-icon-color="#ffffff" title-color="#ffffff" title="调查问卷" :background="background" :border-bottom="false" :is-back="true">
			
		</u-navbar>
		<view class="login-logo">
			<image src="../../static/image/ic-juan.png" style="width:97rpx;height: 96rpx;"></image>
			<view class="c255 fz16 u-font-bold mt25">{{info.name}}</view>
			
			<view class="lh24 module-content brs5 fz12 c255 p20 mt20" v-html="info.description"></view>
		</view>
		<view class="login-btn" @click="toAdd">
			<view class="btn1 fz14">开始填写</view>
		</view>
		
		
	</view>
</template>
<script>
	export default {
		data() {
			return {
				background: {},
				bgUrl:'https://byq.cdevelopment.cn/admin-api/infra/file/18/get/045f99c32fd7e2c1ee9ea3cb2d93e391e5a0098e6ff9ea4ad4a7c51fe18a0ad5.png',
				info:{},
			}
		},
		onLoad(e) {
			this.getInfo(e.id)
			
		},
		onShareAppMessage(e) {},
		// #ifdef MP-WEIXIN
		onShareTimeline() {
			return this.mpShare
		},
		// #endif
		methods: {
			toAdd(){
				if (!this.$db.get("userToken")) {
				
					this.$common.errorToShow('请先登录！')
					uni.navigateTo({
						url: '/pages/login/index'
					})
					return
				}
				uni.navigateTo({
					url:'/pages/question/list?id='+this.info.id
				})
			},
			getInfo(id){
					this.$api.questionInfo({id}, res => {
						if (res.code == 200) {
							this.info = res.data
						}
					})
			},
		},
	}
</script>
<style lang="scss">
	.page-login{
		background-position: center;
		background-repeat: no-repeat;
		background-size:cover;
		height: 100vh;
		.login-logo{
			padding: 40rpx;
			position: fixed;top: 50%;margin-top: -500rpx;
			left: 0;
			right: 0;
			text-align: center;
		}
		.login-btn{
			
				position: fixed;bottom: 50px;
				left: 0;
				right: 0;
				padding: 30rpx;
		}
		
		.btn1{
			
				width: 100%;
				height: 88rpx;
				text-align: center;
				color: #fff;
				line-height: 88rpx;
				background: #ABC7C9;
				border-radius: 40px;
		}
		.btn2{
			
				width: 100%;
				height: 88rpx;
				text-align: center;
				color: #fff;
				margin-top: 20rpx;
				line-height: 88rpx;
		}
	}
	.module-content{
		background: rgba(171,199,201,0.3);
	}
</style>